﻿// -----------------------------------------------------------------------
// <copyright file="TaskWriteMemory.cs" company="DarkBone">
// DarkBone
// </copyright>
// -----------------------------------------------------------------------

namespace DarkBone.Engine.Tasks
{
   using System;

   /// <summary>
   /// Task to Write Memory
   /// </summary>
   [Serializable]
   public class TaskWriteMemory : Task
   {
      /// <summary>
      /// Address to Write
      /// </summary>
      private IntPtr addressToWrite;

      /// <summary>
      /// How many bytes memWriteer should Write
      /// </summary>
      private readonly int bytesToWrite;

      /// <summary>
      /// bytes Write
      /// </summary>
      private byte[] bytes;

      /// <summary>
      /// Initializes a new instance of the <see cref="TaskWriteMemory"/> class. 
      /// </summary>
      /// <param name="addressToWrite">
      /// Address to Write
      /// </param>
      /// <param name="bytesToWrite">
      /// How many bytes memWriteer should Write
      /// </param>
      public TaskWriteMemory(IntPtr addressToWrite, int bytesToWrite)
      {
         this.Id = ID.WriteMemory;
         this.addressToWrite = addressToWrite;
         this.bytesToWrite = bytesToWrite;
         this.bytes = new byte[bytesToWrite];
      }

      /// <summary>
      /// Gets or sets bytes
      /// </summary>
      public IntPtr AddressToWrite
      {
         get
         {
            return this.addressToWrite;
         }

         set
         {
            this.addressToWrite = value;
         }
      }      

      /// <summary>
      /// Gets or sets bytes
      /// </summary>
      public byte[] Bytes
      {
         get
         {
            return this.bytes;
         }

         set
         {
            this.bytes = value;
         }
      }      
   }
}
